
import 'package:package_info_plus/package_info_plus.dart';

class AppInfoUtil{
  static PackageInfo? packageInfo;
  static init() async{
    packageInfo = await PackageInfo.fromPlatform();
  }
  static String? getVersionString(){
    return packageInfo?.version?.toString();
  }

  static String? getAppNameString(){
    return packageInfo?.appName?.toString();
  }

  static String? getBuildNumberString(){
    return packageInfo?.buildNumber?.toString();
  }

  static String? getPackageNameString(){
    return packageInfo?.packageName?.toString();
  }
  //APP名称
  String? appName = packageInfo?.appName;
  //包名
  String? packageName = packageInfo?.packageName;
  //版本名
  String?  version = packageInfo?.version;
  //版本号
  String? buildNumber = packageInfo?.buildNumber;

}